Ext.define('extjs6test.proxy.AbstractProxy', {
    extend: 'Ext.data.proxy.Ajax',
    alias: 'proxy.baseproxy',
    pageParam: 'page',
    limitParam: 'pageSize',
    noCache:false,
    startParam:'',
    headers:{
        "userKey":function(){
            var loginDataStore=Ext.getStore("extjs6test.store.Token");
            return loginDataStore.first().data.token;
        }()
    },
    paramsAsJson:true,
    actionMethods: {
        create: 'PUT',
        read: 'POST',
        update: 'PATCH',
        destroy: 'DELETE'
    },
    reader: {
        type: 'json',
        rootProperty: 'data',
        successProperty: 'success',
        totalProperty: 'total'
    },
    writer: {
        type: 'json',
        // store同步时候的设置
        writeAllFields: true,
        // allowSingle: false,
        expandData: true
        // writeRecordId:false
    }
});
